Resource Allocation Problem Multistage Graph Solution